<?php

if ($_GET['s'] == '/app/yxauth/auth.php') {
    $_GET['s'] = '/mobile/wxapp_auth/index';
}

if ($_GET['c'] == 'home' && $_GET['a'] != 'getwxapp' && $_GET['a'] != 'welcome') {
    $_GET['s'] = '/mobile/oa/' . $_GET['a'];
}
switch ($_GET['s']) {
    case '/web/index.php':
        $s = '/index.php';
        break;
    case '/app/00rewrite.php':
        $s = '/index.php';
        break;
    case '/app/index.php':
        $s = '/index.php';
        break;
    case '/app/wxapp.php':
        $s = '/index.php';
}
if (strstr($_GET['s'], '.php')) {//&& !in_array($_GET['s'], ['/web/index.php', '/app/00rewrite.php', '/app/index.php', '/app/wxapp.php', '/app/00wxapp.php'])
    exit('Access Denied');
}
/*if ($_GET['s'] == '/mobile//') {
    header("HTTP/1.0 404 Not Found");
    exit;
}
if (strstr(basename($_GET['s']), '.') && strstr(basename($_GET['s']), '.aspx') == false && strstr(basename($_GET['s']), '.php') == false) {
    header("HTTP/1.0 404 Not Found");
    echo '<html>
<head><title>404 Not Found</title></head>
<body>
<center><h1>404 Not Found</h1></center>
<hr><center>nginx</center>
</body>
</html>
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
<!-- a padding to disable MSIE and Chrome friendly error page -->
';
    exit;
}*/


// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

// [ 应用入口文件 ]
//定义全局变量 $_G 为应用层全局变量 $_P为全局接收参数
global $_G, $_P;
$_G = $_P = [];
// 定义应用目录
define('APP_PATH_SYS', __DIR__ . '/../application/');

// 加载框架引导文件
require __DIR__ . '/../thinkphp/start.php';




